Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 14, 2026

OGNL 3.3.5 throws source is null for getProperty(null, "X") when expressions access properties on null objects (e.g., params[2].field where params[2] is null). This crashes TimeTunnel and other commands using condition expressions.

Changes

  • OgnlExpress.get(): Catch OgnlException containing "source is null for getProperty" and return null instead of propagating. Provides null-safe navigation similar to optional chaining.

  • Tests: Added unit and integration tests covering null property access, null array indexing, and realistic Advice scenarios with null params/returnObj.

Example

// Before: throws OgnlException
express.bind(advice).get("params[2].field");  // params[2] is null

// After: returns null
express.bind(advice).get("params[2].field");  // → null

Condition expressions like params[2] != null && params[2].field == "value" now evaluate correctly instead of crashing on the first null access.

Original prompt

This section details on the original issue you should resolve

<issue_title>source is null for getProperty(null, "2")</issue_title>
<issue_description>- [x] 我已经在 issues 里搜索,没有重复的issue。

环境信息

  • arthas-boot.jar 或者 as.sh 的版本: 4.1.2
-12-17 16:06:30 [syncDataThreadPool5-1] WARN  c.t.a.c.c.m.TimeTunnelAdviceListener -tt failed.
com.taobao.arthas.core.command.express.ExpressException: ognl.OgnlException: source is null for getProperty(null, "2")
	at com.taobao.arthas.core.command.express.OgnlExpress.get(OgnlExpress.java:39)
	at com.taobao.arthas.core.command.express.OgnlExpress.is(OgnlExpress.java:45)
	at com.taobao.arthas.core.advisor.AdviceListenerAdapter.isConditionMet(AdviceListenerAdapter.java:119)
	at com.taobao.arthas.core.command.monitor200.TimeTunnelAdviceListener.afterFinishing(TimeTunnelAdviceListener.java:75)
	at com.taobao.arthas.core.command.monitor200.TimeTunnelAdviceListener.afterReturning(TimeTunnelAdviceListener.java:58)
	at com.taobao.arthas.core.advisor.AdviceListenerAdapter.afterReturning(AdviceListenerAdapter.java:57)
	at com.taobao.arthas.core.advisor.SpyImpl.atExit(SpyImpl.java:68)
	at java.arthas.SpyAPI.atExit(SpyAPI.java:64)

这个一般是什么原因导致的。</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI changed the title [WIP] Fix null source error in OgnlExpress Fix OGNL null pointer exception in condition expression evaluation Jan 14, 2026
Copilot AI requested a review from hengyunabc January 14, 2026 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

source is null for getProperty(null, "2")

3 participants